package io1;

import java.io.FileOutputStream;
import java.io.IOException;

public class FinallyDemo2 {
    public static void main(String[] args) {
        System.out.println("开始");
        FileOutputStream fos=null;
        try {
            fos=new FileOutputStream("./a/b/fos.dat");
            fos.write(24);
        }catch (IOException e){
            System.out.println("万一");
        }finally {
           try {
               fos.close();
           }catch (Exception e){
               System.out.println("解决关闭异常");
           }
            System.out.println("结束");
        }
    }
}
